<include file="public:header"/>
<load href="__TMPL__public/css/index.css" />
<load href="__TMPL__public/js/user_tip.js" />
<load href="__ROOT__/statics/js/jquery.lazyload.js" />
<load href="__ROOT__/statics/js/jquery/plugins/jquery.KinSlideshow-1.2.1.min.js" />
<div class="content">
	 <div class="step"><img src="__TMPL__public/images/step.png" /></div>
     <div class="index_top box_shadow mt15 clearfix">
        	<div class="index_focus fl">
            	<script type="text/javascript">
				$(function(){	
						$("#KinSlideshow").KinSlideshow({
								moveStyle:"down",
								intervalTime:5,
								mouseEvent:"mouseover",
								isHasTitleFont:true,
								isHasTitleBar:true,
								titleFont:{TitleFont_size:13,TitleFont_color:"#FF0000"},
								titleBar:{titleBar_height:30,titleBar_alpha:0.5}
						});
				});
				</script>
            	<div id="KinSlideshow" style="visibility:hidden;">
				<volist name="ad_list" id="ad">
                <a href="{:u('focus/click',array('id'=>$ad['id']))}" target='_blank'><img src="__ROOT__/{$ad.img}" alt="{$ad.title}" width="610" height="280"/></a>
                </volist>
                </div>
        	</div>
        	<div class="index_active fr">
          		<h3 class="f16">热门<em class="red">活动</em></h3>
         		<div class="hot_area">
            		<div class="l_pic fl">
                    	<a target="_blank" href="<if condition="$top_actives['url'] neq ''">{$top_actives.url}<else/>{:u('article/index',array('id'=>$top_actives['id']))}</if>"><img alt="{$top_actives.title}" style="width:80px; height:80px;" src="__ROOT__/data/news/{$top_actives.img}"></a>
                    </div>
            		<div class="r_txt fl">
              			<h3 class="f14"><a target="_blank" href="<if condition="$top_actives['url'] neq ''">{$top_actives.url}<else/>{:u('article/index',array('id'=>$top_actives['id']))}</if>" class="red">{$top_actives.title}</a></h3>
              			<p class="des">{$top_actives.abst}</p>
            		</div>
                    <div class="clearfix"></div>
                    <div class="g_txt mt15">
                      <ul>
                    	<volist name="hot_actives" id="val" key="key">
                        	<li class="clearfix"> <b class="fl">{$key}</b> <a class="fl f14" target="_blank" href="<if condition="$val['url'] neq ''">{$val.url}<else/>{:u('article/index',array('id'=>$val['id']))}</if>">{$val.title}</a></li>
                        </volist>
                      </ul>
                    </div>
          		</div>
        	</div>
      	</div>

<if condition="$display_b2c_ad eq 1">
	<!--B2C随机广告-->
	<div class="mt15">
		<volist name="ad_rel" id='val' key='key'> 
			<if condition="$key eq 1">			       		
				<a href="javascript:void(0)" style="border:none; margin-right:20px;" onclick="window.open('{$val['click_url']}')"><img src="{$val.pic_url}" /></a>
				<else/>
				<a href="javascript:void(0)" style="border:none;" onclick="window.open('{$val['click_url']}')"><img src="{$val.pic_url}" /></a>
			</if>
		</volist>
	</div>
</if>
<!--B2C随机广告结束-->
<!--大家正在喜欢-->
<div class="main_3">
		<div class="latestLike box-shadow">
			<div class="hd">
				<h2><span class="more"><a href="{:u('search/index')}" target="_blank">更多&gt;</a></span>大家刚刚喜欢了...</h2>
			</div>
			<div class="bd" id="J_LatestLike">
				<div class="luckyMask"></div>
				<ul style="margin-left: 0px; opacity: 1; ">				
					<volist name="lately_like" id='val'>
		            	<li style="display: list-item; ">
							<div class="luckyBaobei">
								<a href="{:u('item/index',array('id'=>$val['items_id']))}" target="_blank" title="{$val['title']}"><img src="{$val.img}" alt="{$val.title}" style="width:120px;" /></a>
							</div>
							<div class="user">						
								<a href="{:u('uc/index',array('uid'=>$val['uid']))}"><img src="{:getUserFace($val['uid'])}" class="tipuser" uid='{$val['uid']}' width="30px" height="30px"/></a>
								<span class="name ofh"><a href="{:u('uc/index',array('uid'=>$val['uid']))}" title="{$val['uname']}" target="_blank">{$val['uname']}</a></span>
								<span class="baobeiNum">
									{$val['time']}分钟前
								</span>
							</div>
						</li>		
					</volist>
	            </ul>
			</div>
		</div>
</div>

<!--刚刚喜欢结束-->
<!--商品循环开始-->
<div id="container">
<volist name="index_group_cates" id='val'>
	<div class="mt20 clearfix">
    	<span class="fr"><a target="_blank" class="gray" href="{:u('cate/index',array('cid'=>$val['id']))}">更多<samp>&gt;&gt;</samp></a></span>
        <h2 class="fl index_h2"><span class="bea77d">微购族分享的</span> <a target="_blank" href="{:u('cate/index',array('cid'=>$val['id']))}"><span class="red" style="font-size:20px;">{$val.name}</span></a></h2>
        <ul class="guide_links fl">
        	<volist name="val['s']" id='sval'>
        	<li><a target="_blank" href="{:u('cate/index',array('cid'=>$sval['id']))}">{$sval.name}</a></li>
            </volist>
        </ul>
    </div>    
    <volist name="val['g']" id='gval' key="key">
    <div class="cate_box <if condition="$key%4 eq 1">alpha<elseif condition="$key%4 eq 0" />omega</if>">
		<div class="box_shadow mt15 group_box">
		<div class="groupbg">
			<h3 class="f16 bold"><a target="_blank" href="{:u('cate/index',array('cid'=>$gval['id']))}">{$gval.name}</a></h3>
			<!--a target="_blank" href="{:u('cate/index',array('cid'=>$gval['id']))}" class="mt5 cursor block g_db_bg"></a-->
				<ul>
	            	<volist name="gval['items']" id='gi' key="gikey"> 						       		
	        			<li <if condition="$gikey eq 1">class="first"</if> <if condition="($gikey eq 2) or ($gikey eq 3) or ($gikey eq 6)">style="margin-right: 0;"</if>><a title="{$gi['title']}" target="_blank" href="{:U('item/index',array('id'=>$gi['id']))}"><img alt="{$gi['title']}" <if condition="$gikey eq 1">style="height:130px; max-width:130px;"</if>  url="{:base64_encode($gi['simg'])}" src="__TMPL__public/images/grey.gif" /></a></li>
	        		</volist>
				</ul>
			
			<div class="group_desc mt10">
				<span class="follow_red_btn tc cursor fr"><a target="_blank" href="{:u('cate/index',array('cid'=>$gval['id']))}" class="white">去看看</a></span>
				<span class="share_nums gray">{$gval.item_nums}个宝贝</span>
			</div>
			<div class="mt10"></div>
		</div>
		</div>
	</div>
    </volist>
    <div class="clearfix"></div>
    
</volist>
</div>
</div>
<!--广告开始-->
<div class="mt15"><script language="javascript" src="{:u('advert/index', array('id'=>6))}"></script></div>
<!--广告结束-->
<!--banner效果-->
<script type="text/javascript">
	var photo = "";
	if(photo == ""){
		photo = "http://static.guang.com/images/user/photo/avatar-50.png";
	}else{
		photo = "http://img.guang.com/"+photo;
	}
	GUANGER = { 
		userId:"",
		userPhoto:photo,
		nick:"",
		path:"",
		isBlack: "",
		checkInTotalScore: "", 
		checkInDays: "",
		referer : "",
		login : ""
	}	
</script>
<load href="__TMPL__public/js/fan-min.js" />
<script type="text/javascript">
$(function() {
	
	var likerLen = $("#J_LatestLike ul").children().length;
	for(var i = 1;i < likerLen;i++){
		var num = likerLen-1-i;
		$("#J_LatestLike ul li:eq("+num+")").appendTo($("#J_LatestLike ul"));
	} 
	for(var j = 0;j < 5;j++){
		$("#J_LatestLike ul").find("li:last").prependTo($("#J_LatestLike ul"));
	}
	$("#J_LatestLike").feedSlider({direction: "right"});
	$("#J_login").click(function(){
		jQuery.guang.dialog.isLogin();
	});
	$("body").css("height","auto");
	$(".startbtn").click(function(){
		$(".startbg").animate({
			marginTop: -1 * $("body").height()
		},500,function(){			
			$(".startbg").hide();
			$(".thepage").fadeIn();
			$("body").css("height","auto");
		});
	});
	$(".startpage .guys li").hover(
		function(){
			$(this).find(".name").animate({
				bottom:0
			},200);
		},
		function(){
			$(this).find(".name").animate({
				bottom:-18
			},200);
		}
	);
	$(".guys").data("loaded",false);
	
	//滚动图初始函数
	$(".scrollable").scrollImg({
		timer:10000,
		startHandle:function(api){
			if(api){
				setTimeout(function(){
					api.playlol(0);
					api.changeClass(0);
					api.autoPlay();
				},10000)
			}
			var lazyScroll = null;
			$(".navi li").each(function(i){
				$(this).unbind();
				$(this).hover(function(){
					if(lazyScroll!=null)clearTimeout(lazyScroll);
					lazyScroll = setTimeout(function(){
						api.changeClass(i);
						api.stopAuto();
						api.playlol(i);
					},200)
				},function(){
					if(lazyScroll!=null)clearTimeout(lazyScroll);
					api.autoPlay();
				})
			}) 
		}
	});
	//延迟加载图片
    $("#container img").lazyload({ 
		effect : "fadeIn",
        threshold : 200
	});

});
</script>

<include file="public:footer"/>
